<template>
		<view class="shoppingList" 
			@click="toshopDetails(listItem.goodsCode)">
			
			<view class="img">
				<!-- <image mode="heightFix" :src="listItem.goodsMainImage" alt=""> -->
				<image mode="aspectFill" :src="listItem.goodsMainImage" alt="">
			</view>
			<view class="bottom">
				<view class="title">
					<view class="isNew" v-if="listItem.isNew">新品发售</view>
					{{listItem.goodsName}}
				</view>
				<view class="price">
					<view class="priceNum" v-if="listItem.goodsPrice">
						<text class="cny" decode>￥{{nbsp}}</text> <text class="cn">{{listItem.goodsPrice}}</text>
					</view>
					<view class="priceNum" v-if="!listItem.goodsPrice">
						<text class="cny" decode>￥{{nbsp}}</text> <text class="cn">暂无售价</text>
					</view>
					<!-- <view class="pricePeople">2.9万+人付款</view> -->
				</view>
			</view>
		</view>
</template>

<script>
	export default {
		data(){
			return{
				nbsp: '&nbsp;',
			}
		},
		name:'shopping-list',
		props:{
			// 商品列表数据
			listItem:{
				default: false
			}
		},
		methods:{
			// 去商品详情页
			toshopDetails(id) {
				uni.navigateTo({
					url: "/pagesA/HomePage/ShopDetails?id=" + id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.shoppingList {
		width: 340rpx;
		height: 498rpx;
		background: #FFFFFF;
		border-radius: 8rpx;
		margin-bottom: 24rpx;
		box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(153,153,153,0.12);
		.img {
			width: 340rpx;
			height: 340rpx;
			background: #FFFFFF;
			text-align: center;
			border-radius: 8rpx;
			overflow: hidden;
	
			image {
				width: 100%;
				height: 100%;
			}
		}
	
		.bottom {
			width: 308rpx;
			height: 158rpx;
			margin-left: 16rpx;
			// border-top: 2rpx solid rgba(51, 51, 51, 0.08);
	
			.title {
				margin-top: 8rpx;
				width: 308rpx;
				height: 80rpx;
				font-size: 28rpx;
				font-weight: 400;
				color: #333333;
				line-height: 40rpx;
	
				word-break: break-all;
				text-overflow: ellipsis;
				overflow: hidden;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
	
				.isNew {
					vertical-align: top;
					margin-top: 5rpx;
					// margin-top: -4rpx;
					display: inline-flex;
					// padding-left: 14rpx;
					align-items: center;
					justify-content: center;
					margin-right: 8rpx;
					width: 112rpx;
					height: 36rpx;
					font-size: 20rpx;
					font-weight: 400;
					color: #FFFFFF;
					// line-height: 28rpx;
					background: url(https://lzmordershop.oss-cn-hangzhou.aliyuncs.com/static/HomePage/isNew.png) no-repeat;
					background-size: 100%;
				}
	
			}
	
			.price {
				display: flex;
				justify-content: space-between;
				margin-top: 20rpx;
				align-items: center;
	
				.priceNum {
					// width: 68rpx;
					height: 28rpx;
					font-weight: 600;
					color: #FF5C46;
					// line-height: 28rpx;
					align-items: center;
					display: flex;
	
					.cny {
						font-size: 24rpx;
					}
	
					.cn {
						font-size: 28rpx;
					}
				}
	
				// .pricePeople {
				// 	width: 146rpx;
				// 	// height: 24rpx;
				// 	font-size: 24rpx;
				// 	font-weight: 400;
				// 	color: #999999;
				// 	// line-height: 24rpx;
				// }
			}
		}
	}
</style>